<?php
/*
 * Created on 2008-5-9
 *
 * File:news.php
 * Author:David Meng
 * Site:http://www.systn.com
 * Email:mdchinese@gmail.com
 *
 */
	
	//编辑新闻
	$subject	= '缓存管理';
	$page_title = $subject;
	$type		= $action;
	$form_src	= 'action='.$action.'&todo=update';
	$from_button= true;		//显示编辑按钮
	
		//添加数据
		if($todo=='update'){



			//没有错误则写入数据
			if(!$error){
				//编辑资料
					if ($oSys){
						
						//获得站内新闻
						$news_ls = $db->query("SELECT * FROM news ORDER BY id DESC",10);
						
						//首页图片列表
						$photo_ad = $db->query("SELECT * FROM home_photo_ad ORDER BY id DESC",8);
						
						//友情连接
						$interested_link = $db->query("SELECT * FROM interested ORDER BY id ASC");
						
						//软件推荐
						$soft_hot = $db->query("SELECT * FROM home_soft ORDER BY id ASC");
						
						//软件文章
						$art_cate = $db->query("SELECT * FROM articles_cate GROUP BY id",10);
						
						
						//去除html
						$art_user['content'] = perg_html($art_user['content']);
						
						//程序手册
						$manual_list = $db->query("SELECT * FROM manual_more GROUP BY id ORDER BY RAND()");
						
						
						//培训最新文章
						$peixun		= $db->rows("SELECT * FROM peixun ORDER BY id DESC",1);
						
						$peixun_list = $db->query("SELECT * FROM peixun ORDER BY id DESC",10);
						
						//首页
						$tpl->set_var(array(
								'_dir'=>'global',
								'_info'=>$info,
								'_siteurl'=>$siteurl,
							)
						);
						$tpl->set_file("index",$tpl_set['TemplateDir'].'/global');
						$htm_data = $tpl->r();
						
						//写入数据提供资料
						$wdata 	= array(
							'write_id'=>'index',	//写入id
							'write_file'=>'../',					//写入地址
							'subject'=>'首页',				//文章标题
							'data'=>$htm_data,							//区块数据
						);
							
						//写入静态
						$oHtml->writer($wdata);
						
						msg('恭喜，操作数据成功!',$sys_page."?model=$model&action=$action",3);
					}else {
						msg('操作数据失败!');
					}
				
			}else{
				msg('操作数据失败!');
			}
		}
	
	
	$tpl->set_file('sys_cache');
	$fpage = $tpl->r();
?>